package com.chapter17;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.Window;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class FutureValueSepIncFrame extends JFrame
  {
   private static final long serialVersionUID = 1;

   public FutureValueSepIncFrame()
     {
      setTitle("Future Value Calculator");
      centerWindow(this);
      setSize(267, 200);
      setResizable(false);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      JPanel panel = new FutureValueSepIncPanel();
      this.add(panel);
     }

   private void centerWindow(Window w)
     {
      Toolkit   tk = Toolkit.getDefaultToolkit();
      Dimension d  = tk.getScreenSize();
      setLocation((d.width-w.getWidth())/2, (d.height-w.getHeight())/2);
     }
  }
